package com.bestow.basic.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestow.basic.mapper.FndCurrencyMapper;
import com.bestow.basic.domain.FndCurrency;
import com.bestow.basic.service.IFndCurrencyService;

/**
 * 币种Service业务层处理
 * 
 * @author liliu
 * @date 2022-09-02
 */
@Service
public class FndCurrencyServiceImpl implements IFndCurrencyService 
{
    @Autowired
    private FndCurrencyMapper fndCurrencyMapper;

    /**
     * 查询币种
     * 
     * @param currencyCode 币种主键
     * @return 币种
     */
    @Override
    public FndCurrency selectFndCurrencyByCurrencyCode(String currencyCode)
    {
        return fndCurrencyMapper.selectFndCurrencyByCurrencyCode(currencyCode);
    }

    /**
     * 查询币种列表
     * 
     * @param fndCurrency 币种
     * @return 币种
     */
    @Override
    public List<FndCurrency> selectFndCurrencyList(FndCurrency fndCurrency)
    {
        return fndCurrencyMapper.selectFndCurrencyList(fndCurrency);
    }

    /**
     * 新增币种
     * 
     * @param fndCurrency 币种
     * @return 结果
     */
    @Override
    public int insertFndCurrency(FndCurrency fndCurrency)
    {
        fndCurrency.setCreateTime(DateUtils.getNowDate());
        return fndCurrencyMapper.insertFndCurrency(fndCurrency);
    }

    /**
     * 修改币种
     * 
     * @param fndCurrency 币种
     * @return 结果
     */
    @Override
    public int updateFndCurrency(FndCurrency fndCurrency)
    {
        fndCurrency.setUpdateTime(DateUtils.getNowDate());
        return fndCurrencyMapper.updateFndCurrency(fndCurrency);
    }

    /**
     * 批量删除币种
     * 
     * @param currencyCodes 需要删除的币种主键
     * @return 结果
     */
    @Override
    public int deleteFndCurrencyByCurrencyCodes(String[] currencyCodes)
    {
        return fndCurrencyMapper.deleteFndCurrencyByCurrencyCodes(currencyCodes);
    }

    /**
     * 删除币种信息
     * 
     * @param currencyCode 币种主键
     * @return 结果
     */
    @Override
    public int deleteFndCurrencyByCurrencyCode(String currencyCode)
    {
        return fndCurrencyMapper.deleteFndCurrencyByCurrencyCode(currencyCode);
    }
}
